﻿using MicroCloud.EventBuses;
using MicroCloud.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace Vinno.Brand.Pack.Core
{
    public partial class BrandService : IBrandService
    {
        /// <summary>
        /// 初始化一个业务实现：小程序服务（<see cref="BrandService"/>）的新实例
        /// </summary>
        /// <param name="provider">服务提供者</param>
        public BrandService(IServiceProvider provider)
        {
            ServiceProvider = provider;
        }

        #region 基础属性
        /// <summary>
        /// 获取 服务提供者对象
        /// </summary>
        protected IServiceProvider ServiceProvider { get; }

        /// <summary>
        /// 获取 事件总线
        /// </summary>
        protected IEventBus EventBus => ServiceProvider.GetService<IEventBus>();

        /// <summary>
        /// 获取 日志对象
        /// </summary>
        protected ILogger Logger => ServiceProvider.GetLogger(GetType());

        #endregion

    }
}
